package com.mopon.clean;

import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.List;

public class RemoveDeletedPath {

	public static void main(String[] args) throws Exception {
		// 所有待删除的目录
		FileReader reader = new FileReader("d:/allpath.txt");
		BufferedReader br = new BufferedReader(reader);
		List<String> allPathList = new ArrayList<String>();

		String str = null;
		while ((str = br.readLine()) != null) {
//			System.out.println(str);
			allPathList.add(str);
		}
		
		// 所有待删除的目录
		FileReader dreader = new FileReader("d:/deletepath.txt");
		BufferedReader dbr = new BufferedReader(dreader);
		List<String> deletedList = new ArrayList<String>();

		while ((str = dbr.readLine()) != null) {
//			System.out.println(str);
			deletedList.add(str);
		}
		
		// 去除已删除的目录
		for (String deletedPath : deletedList) {
			if (allPathList.contains(deletedPath)) {
				allPathList.remove(deletedPath);
			}
		}
		
		for (String path : allPathList) {
			System.out.println(path);
		}
		System.out.println(allPathList.size());
		br.close();
		dbr.close();
	}

}
